package com.hzb.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.hzb.common.valid.AddGroup;
import com.hzb.common.valid.ListValue;
import com.hzb.common.valid.UpdateGroup;
import com.hzb.common.valid.UpdateStatusGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ
 * 
 * @author huangZB
 * @email 576566606@qq.com
 * @date 2020-08-26 23:22:10
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * $column.comments
	 */
	@TableId
	@NotNull(message = "修改时品牌Id不能为null",groups = {UpdateGroup.class})
	@Null(message = "添加时品牌Id必须为null",groups = {AddGroup.class})
	private Long brandId;
	/**
	 * $column.comments
	 */
	@NotBlank(message = "品牌名必须提交",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * $column.comments
	 */
	@NotEmpty
	//@URL(message = "logo必须是一个合法的url地址",groups = {AddGroup.class,UpdateGroup.class})
	private String logo;
	/**
	 * $column.comments
	 */
	private String descript;
	/**
	 * $column.comments
	 */
	@NotNull(message = "显示状态不能为空",groups = {AddGroup.class, UpdateStatusGroup.class})
	@ListValue(vals = {0,1},groups = {AddGroup.class,UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * $column.comments
	 */
	@NotEmpty(message = "检索首字母不能为空",groups = {AddGroup.class,UpdateGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索字符必须是一个字母",groups = {AddGroup.class,UpdateGroup.class})
	private String firstLetter;
	/**
	 * $column.comments
	 */
	@Min(value = 0,message = "排序必须是大于0的整数")
	@NotNull(groups = {AddGroup.class,UpdateGroup.class})
	private Integer sort;

}
